<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <body>
 *
 */

// fix setcookie Warning Cannot modify header information 
ob_start();

//allow catching this var from defferent templates
global $CURRENT_PAGE;
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<meta name="viewport" content="width=device-width" />
<title><?php
	/*
	 * Print the <title> tag based on what is being viewed.
	 */
	global $page, $paged;

	wp_title( '|', true, 'right' );

	// Add the blog name.
	bloginfo( 'name' );

	// Add the blog description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		echo " | $site_description";

	// Add a page number if necessary:
	if ( $paged >= 2 || $page >= 2 )
		echo ' | ' . sprintf( __( 'Page %s', ns_text_domaine ), max( $paged, $page ) );

	?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="alternate" type="application/rss+xml" title="Lbotika.com Feed" href="<?php bloginfo('rss2_url'); ?>" />

<link rel="stylesheet" type="text/css" media="all" href="<?php echo ns_theme_path.'/css/reset.css'; ?>" />

<?php if( _gl() == 'ar_MA' ):?>
<link rel="stylesheet" type="text/css" media="all" href="<?php echo ns_theme_path.'/css/960_24_col_rtl.css'; ?>" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="stylesheet" type="text/css" media="all" href="<?php echo ns_theme_path.'/css/rtl.css'; ?>" />
<?php else:?>
<link rel="stylesheet" type="text/css" media="all" href="<?php echo ns_theme_path.'/css/960_24_col.css'; ?>" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<?php endif;?>


<link rel="shortcut icon" href="<?php echo theme_icon; ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<meta property="og:image" content="http://www.amawal.net/wordpress/wp-content/themes/amawal/images/amawal_logo.png"/>

<?php 
	// javascript functions and style sheets
	include(ns_core.'/init_theme_functions.php');
	wp_head();
	
	// Lab functions
	if($_GET['lab_function']) do_action( $_GET['lab_function'] );
?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body>
<div id="wrapper_global" class="container_24">

	<div id="wrapper_header" class="grid_24">
	
		<span id="logo" class="grid_6 suffix_5 alpha"><a href="<?php echo home_url( '/' ) ?>" title="<?php _e( 'Home', ns_text_domaine ) ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/amawal_logo.png" /></a></span>
		
		<div id="header_right" class="grid_13 omega">
		
			<div id="languages" class="grid_13">
				<div>
				<a href="<?php _el('?', 'tz_MA'); ?>" class="first"><span class="flag_tz"></span><p class="tz">ⵜⴰⵎⴰⵣⵉⵖⵜ</p></a>
				<a href="<?php _el('?', 'ar_MA'); ?>"><span class="flag_ar"></span><p>العربية</p></a>
				<a href="<?php _el('?', 'en_US'); ?>"><span class="flag_en"></span><p>English</p></a>
				<!--<a href="<?php _el('?', 'es_ES'); ?>"><span class="flag_es"></span><p>Español</p></a>-->
				<a href="<?php _el('?', 'fr_FR'); ?>" class="last"><span class="flag_fr"></span><p>Français</p></a>
				</div>
			</div>
			<div class="clear"></div>
			<div class="grid_13">
				<div class="rounded">
				<form id="search_form" action="<?php bloginfo('url'); ?>" class="search rounded">
					<p class="loop"></p>
					<input type="text" name="s" class="s rounded" accesskey="s"/>
					<input type="submit" value="<?php _e( 'Search', ns_text_domaine ); ?>" class="rounded" />
				</form>
				</div>
			</div>
			
		</div>
		
		<div class="clear"></div>
		
		<ul id="menu" class="grid_24 <?php if( _gl() == 'ar_MA' ) echo 'rtl'?>">
			<li><a href="<?php echo home_url() ?>/add_new/" class="button rounded"><?php _e( 'Add a new word', ns_text_domaine ); ?></a></li>
			<li><a href="<?php echo home_url() ?>/my_account/" class="button rounded"><?php _e( 'My account', ns_text_domaine ); ?></a></li>
			<li class="social_media_menu">
				<!-- AddThis Button BEGIN -->
				<!--If you do not set the language or use a custom button URL, your buttons will change language automatically based on the user's browser locale setting-->
				<div id="addthis" class="addthis_toolbox addthis_default_style addthis_16x16_style">
					<a class="addthis_button_facebook"></a>
					<a class="addthis_button_twitter"></a>
					<a class="addthis_button_email"></a>	
					<a class="addthis_button_digg"></a>
					<a class="addthis_button_live"></a>
					<a class="addthis_button_google"></a>
					<a class="addthis_button_favorites"></a>
					<a class="addthis_button_print"></a>
					<a class="addthis_button_compact"></a>
				</div>
				<script type="text/javascript"> var addthis_config = {  ui_language: "fr", addthis_bubble_style: "display:none;" } </script>
				<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4d31b9cb4f28d061"></script>
				<!-- AddThis Button END -->
			</li>
		</ul>
		
		<div id="alphabeth_wrap" class="grid_24">
			<ul id="alphabeth"><?php ns_build_alphabet_menu(); ?></ul>
		</div>
		
	</div>
<!--End #wrapper_header-->